package com.dd.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 采购明细表 记录每个采购订单的具体商品信息。
 * </p>
 *
 * @author dhd
 * @since 2024-10-21
 */
@Data
public class PurchaseOrderDetails implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单ID
     */
    private String orderId;

    /**
     * 商品ID
     */
    private Integer productId;

    /**
     * 数量
     */
    private Integer quantity;

    /**
     * 单价
     */
    private Double unitPrice;

    /**
     * 供应商Id
     */
    private Integer supplierId;

    /**
     * 每个商品的小计
     */
    private double subtotal;

    public PurchaseOrderDetails(String orderId, Integer productId,
                                Integer quantity, Double unitPrice,
                                Integer supplierId, double subtotal){
        this.orderId = orderId;
        this.productId = productId;
        this.quantity = quantity;
        this.unitPrice = unitPrice;
        this.supplierId = supplierId;
        this.subtotal = subtotal;
    }

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    private LocalDateTime deletedAt;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 最后修改人
     */
    private String updatedBy;

    /**
     * 版本
     */
    private Integer version;
}
